Option Strict On
Option Explicit On 

Imports System.Windows.Forms
Imports System.Diagnostics

Imports IP.Core.IPdATA
Imports IP.Core.IPUserService
Imports IP.Core.IPCommon
Imports IP.Core.IPException
Imports IP.Core.IPDataControl
Imports C1.Win.C1FlexGrid
Class f040_cm_dm_calendar
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        formatControls()
    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents m_stb_fms_style As System.Windows.Forms.StatusBar
    Friend WithEvents m_stMess As System.Windows.Forms.StatusBarPanel
    Friend WithEvents m_stUser As System.Windows.Forms.StatusBarPanel
    Friend WithEvents m_panel As System.Windows.Forms.Panel
    Friend WithEvents m_cmd_chon As SIS.Controls.Button.SiSButton
    Friend WithEvents m_cmd_tao_lich As SIS.Controls.Button.SiSButton
    Friend WithEvents m_cmd_thoat As SIS.Controls.Button.SiSButton
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents m_fg As C1.Win.C1FlexGrid.C1FlexGrid
    Friend WithEvents ImageList As System.Windows.Forms.ImageList
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(f040_cm_dm_calendar))
        Me.m_stb_fms_style = New System.Windows.Forms.StatusBar
        Me.m_stMess = New System.Windows.Forms.StatusBarPanel
        Me.m_stUser = New System.Windows.Forms.StatusBarPanel
        Me.m_panel = New System.Windows.Forms.Panel
        Me.m_cmd_chon = New SIS.Controls.Button.SiSButton
        Me.ImageList = New System.Windows.Forms.ImageList(Me.components)
        Me.m_cmd_tao_lich = New SIS.Controls.Button.SiSButton
        Me.m_cmd_thoat = New SIS.Controls.Button.SiSButton
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.m_fg = New C1.Win.C1FlexGrid.C1FlexGrid
        CType(Me.m_stMess, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.m_stUser, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.m_panel.SuspendLayout()
        Me.Panel2.SuspendLayout()
        CType(Me.m_fg, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'm_stb_fms_style
        '
        Me.m_stb_fms_style.ImeMode = System.Windows.Forms.ImeMode.NoControl
        Me.m_stb_fms_style.Location = New System.Drawing.Point(0, 287)
        Me.m_stb_fms_style.Name = "m_stb_fms_style"
        Me.m_stb_fms_style.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.m_stMess, Me.m_stUser})
        Me.m_stb_fms_style.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.m_stb_fms_style.ShowPanels = True
        Me.m_stb_fms_style.Size = New System.Drawing.Size(480, 22)
        Me.m_stb_fms_style.TabIndex = 51
        Me.m_stb_fms_style.Text = "statusBar"
        '
        'm_stMess
        '
        Me.m_stMess.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Spring
        Me.m_stMess.Width = 433
        '
        'm_stUser
        '
        Me.m_stUser.AutoSize = System.Windows.Forms.StatusBarPanelAutoSize.Contents
        Me.m_stUser.Icon = CType(resources.GetObject("m_stUser.Icon"), System.Drawing.Icon)
        Me.m_stUser.Width = 31
        '
        'm_panel
        '
        Me.m_panel.Controls.Add(Me.m_cmd_chon)
        Me.m_panel.Controls.Add(Me.m_cmd_tao_lich)
        Me.m_panel.Controls.Add(Me.m_cmd_thoat)
        Me.m_panel.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.m_panel.DockPadding.All = 4
        Me.m_panel.Location = New System.Drawing.Point(0, 255)
        Me.m_panel.Name = "m_panel"
        Me.m_panel.Size = New System.Drawing.Size(480, 32)
        Me.m_panel.TabIndex = 52
        '
        'm_cmd_chon
        '
        Me.m_cmd_chon.AdjustImageLocation = New System.Drawing.Point(0, 0)
        Me.m_cmd_chon.BtnShape = SIS.Controls.Button.emunType.BtnShape.Rectangle
        Me.m_cmd_chon.BtnStyle = SIS.Controls.Button.emunType.XPStyle.Default
        Me.m_cmd_chon.Dock = System.Windows.Forms.DockStyle.Right
        Me.m_cmd_chon.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.m_cmd_chon.ImageIndex = 19
        Me.m_cmd_chon.ImageList = Me.ImageList
        Me.m_cmd_chon.Location = New System.Drawing.Point(328, 4)
        Me.m_cmd_chon.Name = "m_cmd_chon"
        Me.m_cmd_chon.Size = New System.Drawing.Size(74, 24)
        Me.m_cmd_chon.TabIndex = 9
        Me.m_cmd_chon.Text = "&Chọn"
        '
        'ImageList
        '
        Me.ImageList.ImageSize = New System.Drawing.Size(16, 16)
        Me.ImageList.ImageStream = CType(resources.GetObject("ImageList.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageList.TransparentColor = System.Drawing.Color.Transparent
        '
        'm_cmd_tao_lich
        '
        Me.m_cmd_tao_lich.AdjustImageLocation = New System.Drawing.Point(0, 0)
        Me.m_cmd_tao_lich.BtnShape = SIS.Controls.Button.emunType.BtnShape.Rectangle
        Me.m_cmd_tao_lich.BtnStyle = SIS.Controls.Button.emunType.XPStyle.Default
        Me.m_cmd_tao_lich.Dock = System.Windows.Forms.DockStyle.Left
        Me.m_cmd_tao_lich.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.m_cmd_tao_lich.ImageIndex = 14
        Me.m_cmd_tao_lich.ImageList = Me.ImageList
        Me.m_cmd_tao_lich.Location = New System.Drawing.Point(4, 4)
        Me.m_cmd_tao_lich.Name = "m_cmd_tao_lich"
        Me.m_cmd_tao_lich.Size = New System.Drawing.Size(74, 24)
        Me.m_cmd_tao_lich.TabIndex = 6
        Me.m_cmd_tao_lich.Text = "&Lập lịch"
        '
        'm_cmd_thoat
        '
        Me.m_cmd_thoat.AdjustImageLocation = New System.Drawing.Point(0, 0)
        Me.m_cmd_thoat.BtnShape = SIS.Controls.Button.emunType.BtnShape.Rectangle
        Me.m_cmd_thoat.BtnStyle = SIS.Controls.Button.emunType.XPStyle.Default
        Me.m_cmd_thoat.Dock = System.Windows.Forms.DockStyle.Right
        Me.m_cmd_thoat.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.m_cmd_thoat.ImageIndex = 6
        Me.m_cmd_thoat.ImageList = Me.ImageList
        Me.m_cmd_thoat.Location = New System.Drawing.Point(402, 4)
        Me.m_cmd_thoat.Name = "m_cmd_thoat"
        Me.m_cmd_thoat.Size = New System.Drawing.Size(74, 24)
        Me.m_cmd_thoat.TabIndex = 8
        Me.m_cmd_thoat.Text = "&Thoát"
        '
        'Panel1
        '
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Top
        Me.Panel1.Location = New System.Drawing.Point(0, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(480, 48)
        Me.Panel1.TabIndex = 53
        '
        'Panel2
        '
        Me.Panel2.Controls.Add(Me.m_fg)
        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel2.Location = New System.Drawing.Point(0, 48)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(480, 207)
        Me.Panel2.TabIndex = 54
        '
        'm_fg
        '
        Me.m_fg.AllowAddNew = True
        Me.m_fg.BackColor = System.Drawing.Color.WhiteSmoke
        Me.m_fg.ColumnInfo = "8,1,0,0,0,85,Columns:0{Width:20;}" & Microsoft.VisualBasic.ChrW(9) & "1{Width:50;AllowSorting:False;Caption:""Thứ hai""" & _
        ";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "2{Width:50;AllowSorting:False;Cap" & _
        "tion:""Thứ ba"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "3{Width:50;AllowSort" & _
        "ing:False;Caption:""Thứ tư"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "4{Width" & _
        ":50;Caption:""Thứ năm"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "5{Width:50;C" & _
        "aption:""Thứ sáu"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "6{Width:50;Captio" & _
        "n:""Thứ bảy"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9) & "7{Width:50;Caption:""Ch" & _
        "ủ nhật"";DataType:System.String;TextAlign:LeftCenter;}" & Microsoft.VisualBasic.ChrW(9)
        Me.m_fg.Dock = System.Windows.Forms.DockStyle.Fill
        Me.m_fg.ForeColor = System.Drawing.Color.Black
        Me.m_fg.KeyActionEnter = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross
        Me.m_fg.Location = New System.Drawing.Point(0, 0)
        Me.m_fg.Name = "m_fg"
        Me.m_fg.Rows.Count = 51
        Me.m_fg.Size = New System.Drawing.Size(480, 207)
        Me.m_fg.Styles = New C1.Win.C1FlexGrid.CellStyleCollection("Normal{BackColor:WhiteSmoke;ForeColor:Black;Border:Flat,1,Silver,Both;}" & Microsoft.VisualBasic.ChrW(9) & "Alternate" & _
        "{BackColor:Silver;}" & Microsoft.VisualBasic.ChrW(9) & "Fixed{BackColor:Silver;Border:Raised,1,Black,Both;}" & Microsoft.VisualBasic.ChrW(9) & "Highligh" & _
        "t{BackColor:Maroon;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Search{BackColor:Highlight;ForeColor:Highli" & _
        "ghtText;}" & Microsoft.VisualBasic.ChrW(9) & "Frozen{BackColor:Beige;}" & Microsoft.VisualBasic.ChrW(9) & "EmptyArea{BackColor:AppWorkspace;Border:Flat," & _
        "1,ControlDarkDark,Both;}" & Microsoft.VisualBasic.ChrW(9) & "GrandTotal{BackColor:Black;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal0{" & _
        "BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal1{BackColor:ControlDarkDark;" & _
        "ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal2{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal" & _
        "3{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal4{BackColor:ControlDarkDar" & _
        "k;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal5{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9))
        Me.m_fg.TabIndex = 54
        '
        'f040_cm_dm_calendar
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(480, 309)
        Me.Controls.Add(Me.Panel2)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.m_panel)
        Me.Controls.Add(Me.m_stb_fms_style)
        Me.Name = "f040_cm_dm_calendar"
        Me.Text = "M040 - Lich lam viec"
        CType(Me.m_stMess, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.m_stUser, System.ComponentModel.ISupportInitialize).EndInit()
        Me.m_panel.ResumeLayout(False)
        Me.Panel2.ResumeLayout(False)
        CType(Me.m_fg, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

#Region "Public Methods"
    Public Sub display()
        Me.ShowDialog()
    End Sub
#End Region

#Region "Data Structure"
    Private Enum e_num_colum
        Thu_2 = 1
        Thu_3 = 2
        Thu_4 = 3
        Thu_5 = 4
        Thu_6 = 5
        Thu_7 = 6
        Chu_nhat = 7
    End Enum
#End Region

#Region "Members"

#End Region

#Region "Private Methods"
    Private Sub formatControls()
        CControlFormat.setFormStyle(Me, IPFormStyle.DockableTopForm)
        CControlFormat.setC1FlexFormat(m_fg, C1GridStyle.GridInplaceEditing)
        'add event handler
    End Sub

    Private Sub load_data()
        Dim v_us_calendar As New US_CM_DM_CALENDAR
        Try
            Dim v_ds_calendar As New DS_CM_DM_CALENDAR
            v_us_calendar.open_connection()
            v_us_calendar.FillDataset(v_ds_calendar)
            v_us_calendar.commit_close_connection()

        Catch v_e As Exception

        End Try
    End Sub



    Private Sub set_form_initial()
        load_data()
    End Sub
#End Region

    ''
    '' EVANT HANDLERS
    ''

    Private Sub f040_cm_dm_calendar_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        load_data()
    End Sub
End Class
